package defaultability

import (
    "log"
    "errors"
    "topsdk"
    "topsdk/defaultability/request"
    "topsdk/defaultability/response"
    "topsdk/util"
)

type Defaultability struct {
    Client *topsdk.TopClient
}

func NewDefaultability(client *topsdk.TopClient) *Defaultability{
    return &Defaultability{client}
}

/*
    查询指定账户的子账号列表
*/
func (ability *Defaultability) TaobaoSellercenterSubusersGet(req *request.TaobaoSellercenterSubusersGetRequest,session string) (*response.TaobaoSellercenterSubusersGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.subusers.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterSubusersGetResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterSubusersGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    分页获取指定账户的子账号简易信息列表（新isv建议使用taobao.sellercenter.subusers.page接口）
*/
func (ability *Defaultability) TaobaoSubusersPage(req *request.TaobaoSubusersPageRequest,session string) (*response.TaobaoSubusersPageResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subusers.page",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubusersPageResponse{}
    if(err != nil){
        log.Println("taobaoSubusersPage error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定用户的权限集合
*/
func (ability *Defaultability) TaobaoSellercenterUserPermissionsGet(req *request.TaobaoSellercenterUserPermissionsGetRequest,session string) (*response.TaobaoSellercenterUserPermissionsGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.user.permissions.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterUserPermissionsGetResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterUserPermissionsGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取标准类目属性值
*/
func (ability *Defaultability) TaobaoItempropvaluesGet(req *request.TaobaoItempropvaluesGetRequest) (*response.TaobaoItempropvaluesGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.itempropvalues.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoItempropvaluesGetResponse{}
    if(err != nil){
        log.Println("taobaoItempropvaluesGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取当前会话用户出售中的商品列表
*/
func (ability *Defaultability) TaobaoItemsOnsaleGet(req *request.TaobaoItemsOnsaleGetRequest,session string) (*response.TaobaoItemsOnsaleGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.items.onsale.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemsOnsaleGetResponse{}
    if(err != nil){
        log.Println("taobaoItemsOnsaleGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取用户已开通消息
*/
func (ability *Defaultability) TaobaoTmcUserGet(req *request.TaobaoTmcUserGetRequest) (*response.TaobaoTmcUserGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.tmc.user.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoTmcUserGetResponse{}
    if(err != nil){
        log.Println("taobaoTmcUserGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取SKU
*/
func (ability *Defaultability) TaobaoItemSkuGet(req *request.TaobaoItemSkuGetRequest,session string) (*response.TaobaoItemSkuGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.item.sku.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemSkuGetResponse{}
    if(err != nil){
        log.Println("taobaoItemSkuGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    查询appstore应用订购关系
*/
func (ability *Defaultability) TaobaoAppstoreSubscribeGet(req *request.TaobaoAppstoreSubscribeGetRequest) (*response.TaobaoAppstoreSubscribeGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.appstore.subscribe.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoAppstoreSubscribeGetResponse{}
    if(err != nil){
        log.Println("taobaoAppstoreSubscribeGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    根据商品ID列表获取SKU信息
*/
func (ability *Defaultability) TaobaoItemSkusGet(req *request.TaobaoItemSkusGetRequest,session string) (*response.TaobaoItemSkusGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.item.skus.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemSkusGetResponse{}
    if(err != nil){
        log.Println("taobaoItemSkusGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取单个商品详细信息
*/
func (ability *Defaultability) TaobaoItemSellerGet(req *request.TaobaoItemSellerGetRequest,session string) (*response.TaobaoItemSellerGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.item.seller.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemSellerGetResponse{}
    if(err != nil){
        log.Println("taobaoItemSellerGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    批量获取商品详细信息
*/
func (ability *Defaultability) TaobaoItemsSellerListGet(req *request.TaobaoItemsSellerListGetRequest,session string) (*response.TaobaoItemsSellerListGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.items.seller.list.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemsSellerListGetResponse{}
    if(err != nil){
        log.Println("taobaoItemsSellerListGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    查询指定的子账号的权限和角色信息
*/
func (ability *Defaultability) TaobaoSellercenterSubuserPermissionsRolesGet(req *request.TaobaoSellercenterSubuserPermissionsRolesGetRequest,session string) (*response.TaobaoSellercenterSubuserPermissionsRolesGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.subuser.permissions.roles.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterSubuserPermissionsRolesGetResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterSubuserPermissionsRolesGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定卖家的角色列表
*/
func (ability *Defaultability) TaobaoSellercenterRolesGet(req *request.TaobaoSellercenterRolesGetRequest,session string) (*response.TaobaoSellercenterRolesGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.roles.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterRolesGetResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterRolesGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取前台展示的店铺类目
*/
func (ability *Defaultability) TaobaoShopcatsListGet(req *request.TaobaoShopcatsListGetRequest) (*response.TaobaoShopcatsListGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.shopcats.list.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoShopcatsListGetResponse{}
    if(err != nil){
        log.Println("taobaoShopcatsListGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取前台展示的店铺内卖家自定义商品类目
*/
func (ability *Defaultability) TaobaoSellercatsListGet(req *request.TaobaoSellercatsListGetRequest,session string) (*response.TaobaoSellercatsListGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercats.list.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercatsListGetResponse{}
    if(err != nil){
        log.Println("taobaoSellercatsListGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    子账号角色的新增（指定卖家）
*/
func (ability *Defaultability) TaobaoSellercenterRoleAdd(req *request.TaobaoSellercenterRoleAddRequest,session string) (*response.TaobaoSellercenterRoleAddResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.role.add",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterRoleAddResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterRoleAdd error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    订购关系查询
*/
func (ability *Defaultability) TaobaoVasSubscribeGet(req *request.TaobaoVasSubscribeGetRequest) (*response.TaobaoVasSubscribeGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.vas.subscribe.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoVasSubscribeGetResponse{}
    if(err != nil){
        log.Println("taobaoVasSubscribeGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    订单记录导出
*/
func (ability *Defaultability) TaobaoVasOrderSearch(req *request.TaobaoVasOrderSearchRequest) (*response.TaobaoVasOrderSearchResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.vas.order.search",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoVasOrderSearchResponse{}
    if(err != nil){
        log.Println("taobaoVasOrderSearch error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    订购记录导出
*/
func (ability *Defaultability) TaobaoVasSubscSearch(req *request.TaobaoVasSubscSearchRequest) (*response.TaobaoVasSubscSearchResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.vas.subsc.search",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoVasSubscSearchResponse{}
    if(err != nil){
        log.Println("taobaoVasSubscSearch error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    服务平台评价查询接口
*/
func (ability *Defaultability) TaobaoFuwuScoresGet(req *request.TaobaoFuwuScoresGetRequest) (*response.TaobaoFuwuScoresGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.fuwu.scores.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoFuwuScoresGetResponse{}
    if(err != nil){
        log.Println("taobaoFuwuScoresGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    查询卖家用户信息
*/
func (ability *Defaultability) TaobaoUserSellerGet(req *request.TaobaoUserSellerGetRequest,session string) (*response.TaobaoUserSellerGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.user.seller.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoUserSellerGetResponse{}
    if(err != nil){
        log.Println("taobaoUserSellerGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信签名创建接口
*/
func (ability *Defaultability) TaobaoJstSmsSignnameCreate(req *request.TaobaoJstSmsSignnameCreateRequest,session string) (*response.TaobaoJstSmsSignnameCreateResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.jst.sms.signname.create",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoJstSmsSignnameCreateResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsSignnameCreate error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信签名查询
*/
func (ability *Defaultability) TaobaoJstSmsSignnameQuery(req *request.TaobaoJstSmsSignnameQueryRequest,session string) (*response.TaobaoJstSmsSignnameQueryResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.jst.sms.signname.query",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoJstSmsSignnameQueryResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsSignnameQuery error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信签名删除
*/
func (ability *Defaultability) TaobaoJstSmsSignnameDelete(req *request.TaobaoJstSmsSignnameDeleteRequest,session string) (*response.TaobaoJstSmsSignnameDeleteResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.jst.sms.signname.delete",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoJstSmsSignnameDeleteResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsSignnameDelete error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信签名修改
*/
func (ability *Defaultability) TaobaoJstSmsSignnameModify(req *request.TaobaoJstSmsSignnameModifyRequest,session string) (*response.TaobaoJstSmsSignnameModifyResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.jst.sms.signname.modify",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoJstSmsSignnameModifyResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsSignnameModify error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信模板创建
*/
func (ability *Defaultability) TaobaoJstSmsTemplateCreate(req *request.TaobaoJstSmsTemplateCreateRequest) (*response.TaobaoJstSmsTemplateCreateResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.jst.sms.template.create",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoJstSmsTemplateCreateResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsTemplateCreate error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信模板查询
*/
func (ability *Defaultability) TaobaoJstSmsTemplateQuery(req *request.TaobaoJstSmsTemplateQueryRequest) (*response.TaobaoJstSmsTemplateQueryResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.jst.sms.template.query",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoJstSmsTemplateQueryResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsTemplateQuery error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信模板删除
*/
func (ability *Defaultability) TaobaoJstSmsTemplateDelete(req *request.TaobaoJstSmsTemplateDeleteRequest) (*response.TaobaoJstSmsTemplateDeleteResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.jst.sms.template.delete",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoJstSmsTemplateDeleteResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsTemplateDelete error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    淘宝短信模板修改
*/
func (ability *Defaultability) TaobaoJstSmsTemplateModify(req *request.TaobaoJstSmsTemplateModifyRequest) (*response.TaobaoJstSmsTemplateModifyResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.jst.sms.template.modify",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoJstSmsTemplateModifyResponse{}
    if(err != nil){
        log.Println("taobaoJstSmsTemplateModify error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取标准商品类目属性
*/
func (ability *Defaultability) TaobaoItempropsGet(req *request.TaobaoItempropsGetRequest) (*response.TaobaoItempropsGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.itemprops.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoItempropsGetResponse{}
    if(err != nil){
        log.Println("taobaoItempropsGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取后台供卖家发布商品的标准商品类目
*/
func (ability *Defaultability) TaobaoItemcatsGet(req *request.TaobaoItemcatsGetRequest) (*response.TaobaoItemcatsGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.itemcats.get",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoItemcatsGetResponse{}
    if(err != nil){
        log.Println("taobaoItemcatsGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    服务平台营销链接生成接口
*/
func (ability *Defaultability) TaobaoFuwuSaleLinkGen(req *request.TaobaoFuwuSaleLinkGenRequest) (*response.TaobaoFuwuSaleLinkGenResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.fuwu.sale.link.gen",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoFuwuSaleLinkGenResponse{}
    if(err != nil){
        log.Println("taobaoFuwuSaleLinkGen error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    根据当前子账号登陆态，获取该子账号基本信息
*/
func (ability *Defaultability) TaobaoSubusersInfoQuery(req *request.TaobaoSubusersInfoQueryRequest,session string) (*response.TaobaoSubusersInfoQueryResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subusers.info.query",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubusersInfoQueryResponse{}
    if(err != nil){
        log.Println("taobaoSubusersInfoQuery error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    查询商家被授权品牌列表和类目列表
*/
func (ability *Defaultability) TaobaoItemcatsAuthorizeGet(req *request.TaobaoItemcatsAuthorizeGetRequest,session string) (*response.TaobaoItemcatsAuthorizeGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.itemcats.authorize.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemcatsAuthorizeGetResponse{}
    if(err != nil){
        log.Println("taobaoItemcatsAuthorizeGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    得到当前会话用户库存中的商品列表
*/
func (ability *Defaultability) TaobaoItemsInventoryGet(req *request.TaobaoItemsInventoryGetRequest,session string) (*response.TaobaoItemsInventoryGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.items.inventory.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoItemsInventoryGetResponse{}
    if(err != nil){
        log.Println("taobaoItemsInventoryGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    根据外部ID取商品SKU
*/
func (ability *Defaultability) TaobaoSkusCustomGet(req *request.TaobaoSkusCustomGetRequest,session string) (*response.TaobaoSkusCustomGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.skus.custom.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSkusCustomGetResponse{}
    if(err != nil){
        log.Println("taobaoSkusCustomGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定账户的子账号简易信息列表
*/
func (ability *Defaultability) TaobaoSubusersGet(req *request.TaobaoSubusersGetRequest,session string) (*response.TaobaoSubusersGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subusers.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubusersGetResponse{}
    if(err != nil){
        log.Println("taobaoSubusersGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定账户子账号的详细信息
*/
func (ability *Defaultability) TaobaoSubuserFullinfoGet(req *request.TaobaoSubuserFullinfoGetRequest,session string) (*response.TaobaoSubuserFullinfoGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subuser.fullinfo.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubuserFullinfoGetResponse{}
    if(err != nil){
        log.Println("taobaoSubuserFullinfoGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定账户的所有部门列表
*/
func (ability *Defaultability) TaobaoSubuserDepartmentsGet(req *request.TaobaoSubuserDepartmentsGetRequest,session string) (*response.TaobaoSubuserDepartmentsGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subuser.departments.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubuserDepartmentsGetResponse{}
    if(err != nil){
        log.Println("taobaoSubuserDepartmentsGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取指定账户的所有职务信息列表
*/
func (ability *Defaultability) TaobaoSubuserDutysGet(req *request.TaobaoSubuserDutysGetRequest,session string) (*response.TaobaoSubuserDutysGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subuser.dutys.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubuserDutysGetResponse{}
    if(err != nil){
        log.Println("taobaoSubuserDutysGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    修改指定账户子账号的基本信息
*/
func (ability *Defaultability) TaobaoSubuserInfoUpdate(req *request.TaobaoSubuserInfoUpdateRequest,session string) (*response.TaobaoSubuserInfoUpdateResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.subuser.info.update",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSubuserInfoUpdateResponse{}
    if(err != nil){
        log.Println("taobaoSubuserInfoUpdate error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    获取单笔交易的部分信息(商家应用使用)
*/
func (ability *Defaultability) TaobaoOpenTradeGet(req *request.TaobaoOpenTradeGetRequest,session string) (*response.TaobaoOpenTradeGetResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.open.trade.get",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoOpenTradeGetResponse{}
    if(err != nil){
        log.Println("taobaoOpenTradeGet error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    发布单条消息
*/
func (ability *Defaultability) TaobaoTmcMessageProduce(req *request.TaobaoTmcMessageProduceRequest) (*response.TaobaoTmcMessageProduceResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.tmc.message.produce",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoTmcMessageProduceResponse{}
    if(err != nil){
        log.Println("taobaoTmcMessageProduce error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    取消用户的消息服务
*/
func (ability *Defaultability) TaobaoTmcUserCancel(req *request.TaobaoTmcUserCancelRequest) (*response.TaobaoTmcUserCancelResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.Execute("taobao.tmc.user.cancel",req.ToMap(),req.ToFileMap())
    var respStruct = response.TaobaoTmcUserCancelResponse{}
    if(err != nil){
        log.Println("taobaoTmcUserCancel error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    为已授权的用户开通消息服务
*/
func (ability *Defaultability) TaobaoTmcUserPermit(req *request.TaobaoTmcUserPermitRequest,session string) (*response.TaobaoTmcUserPermitResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.tmc.user.permit",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoTmcUserPermitResponse{}
    if(err != nil){
        log.Println("taobaoTmcUserPermit error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
/*
    通过主账号登陆态分页查询子账号列表
*/
func (ability *Defaultability) TaobaoSellercenterSubusersPage(req *request.TaobaoSellercenterSubusersPageRequest,session string) (*response.TaobaoSellercenterSubusersPageResponse,error) {
    if(ability.Client == nil) {
        return nil,errors.New("Defaultability topClient is nil")
    }
    var jsonStr,err = ability.Client.ExecuteWithSession("taobao.sellercenter.subusers.page",req.ToMap(),req.ToFileMap(),session)
    var respStruct = response.TaobaoSellercenterSubusersPageResponse{}
    if(err != nil){
        log.Println("taobaoSellercenterSubusersPage error",err)
        return &respStruct,err
    }
    err = util.HandleJsonResponse(jsonStr, &respStruct)
    if(respStruct.Body == "" || len(respStruct.Body) == 0) {
        respStruct.Body = jsonStr
    }
    return &respStruct,err
}
